home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10533 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  56 lines

  1. Path: news.csl.sni.be!lukyluke
  2. From: David.Brabant@csl.sni.be (David Brabant [SNI])
  3. Newsgroups: comp.lang.c++,comp.os.ms-windows.programmer.misc
  4. Subject: Re: Using class members from DLL
  5. Date: Fri, 08 Mar 96 16:25:32 GMT
  6. Organization: Siemens Nixdorf
  7. Distribution: world
  8. Message-ID: <4hpj9i$bok@iliana.csl.sni.be>
  9. References: <313c67e1.4039445@news>
  10. NNTP-Posting-Host: lukyluke.csl.sni.be
  11. X-Newsreader: News Xpress Version 1.0 Beta #4
  12.  
  13. >Using Microsoft Visual C++, version 1.5 I am looking a way to use a
  14. >class stored in a DLL. How can I get access to the members of a class
  15. >defined in a DLL from a program? Example:
  16. >
  17. >// This is in a DLL
  18. >class CTestList : public CListBox
  19. >{
  20. >public:
  21. >   BOOL IsValid();
  22. >};
  23. >
  24. >// This is in a program
  25. >....
  26. >   CTestList *test = new CTestList; // How to access the constructor
  27. >   if (test->IsValid()) {
  28. >      ...
  29. >      }
  30. >
  31. >Now, the problem is that I can't get the compiler find the public
  32. >IsValid-member of the class. How do I export this 'function'? Do I
  33. >have to use a different prototyping of the class? How can I get this
  34. >working? I don't want to be writing C-code and use that as an
  35. >interface to the class...
  36. >
  37. >I hope this is clear enough. Help would be greatly appreciated.
  38. >
  39. >Bye, Bart.
  40. >P.S. If you can, please reply through emai.
  41.  
  42. Use class __export Foo
  43.           ^^^^^^^^
  44.  
  45. This will export all your public members and you'll
  46. can access them from your executable.
  47.  
  48. David
  49.  
  50. --
  51. David Brabant,             | E-mail: David.Brabant@csl.sni.be
  52. Siemens Nixdorf (SNI),     | CIS:    100337,1733
  53. Centre Software de LiΦge,  | X-400:  C=BE;A=RTT;P=SCN;O=SNI;OU1=LGG1;OU2=S1
  54. 2, rue des Fories,         |         S=BRABANT;G=DAVID
  55. 4020 LiΦge (BELGIUM)       | HTTP:   www.sni.de       www.csl.sni.be/~david
  56.